<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>美容院管理 - 销售业绩管理系统</title>
<style type="text/css">
<!--
.STYLE1 {	color: #FFFFFF;
	font-weight: bold;
	font-size: 12px;
}
.STYLE6 {font-size: 12px; }
.STYLE7 {font-size: 12px; background-color: #f5f5f5;margin:0;}
body { 
margin:0;
}
-->
</style>
</head>

<body margin=0>

<table width="100%" bgcolor="#FFFFFF"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="28" class="STYLE7">美容院管理 &gt;美容院修改</td>
  </tr>
  <tr>
    <td valign="top"><table width="100%" align="center" >
      <tr>
      <input id="shopid" type="hidden"></input>
        <td height="25" colspan="2" bordercolor="#000000" bgcolor="#1C94C4"><div align="center" class="STYLE1">美容院信息修改</div></td>
      </tr>
      <tr>
        <td width="32%" height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;所属业务员名称：</div>
        </div></td>
        <td width="68%" height="22" bgcolor="#f5f5f5"><span class="STYLE6">
        <input id="ywyid" type="hidden"></input>
          <input id="ywyname" name="textfield" type="text"  disabled="disabled" value="dwliujianqiang1" size="15"/> 
          <a href="#" onclick="showUsers()">
          <input type="button" name="Submit2" value="选择业务员名称" /></a> 
          </label>
        </span></td>
      </tr>
	  <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;美容院名称：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><span class="STYLE6">
          <input id="mryname" name="textfield3" type="text" value="万娜美容院" />
          </label>
        </span></td>
      </tr>
       <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;美容院编号：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><span class="STYLE6">
          <input id="mrybh" name="textfield3" type="text" value="万娜美容院" />
          </label>
        </span></td>
      </tr>
	 <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;位置分布：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><select id="wzfb" name="select">
		
          <option >左</option>
          <option>右</option>
        
        </select>
        </td>
	  </tr> 
	
      <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;地址：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><input id="address" name="textfield22" type="text" value="北京朝阳区" /></td>
      </tr>
      <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;所属城市：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><select id="cities" name="select">
        </select></td>
      </tr>
	  <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;来源类型：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><select id="lylx" name="select">
          <option selected="selected">推荐</option>
          <option>朋友介绍</option>
          <option>产品质量</option>
        </select>
        </td>
	  </tr>
      <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;联系人(法人)：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><input id="lxr" name="textfield2222" type="text" value="万丽" /></td>
      </tr>
      <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;联系电话：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><span class="STYLE6"><input id="telphone" name="textfield2222" type="text" value="13600000000" />
          
        </span> </td>
      </tr>
       <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;银行卡号：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><input id="banknum" name="banknum" /></td>
      </tr>
       <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;累计积分：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><input id="initintegral" name="textfield2" type="text" value="0" size="10"/></td>
      </tr>
   <!--    <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;累计核销积分：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><input id="ljhxjf" name="textfield2" type="text" value="0" size="10" disabled="disabled"/></td>
      </tr> -->
      <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;备注：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><textarea id="bz" name="textarea" rows="5"></textarea></td>
	  </tr>
       <tr id="downshop">
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;美容院下放：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"> <input type="checkbox" id="checkbox" name="checkbox" value="checkbox" onclick="clickCheckbox()"/></td>
	  </tr>
      
    </table>
	<table width="100%" align="center" id="xiafang" style="display:none">
	<tr >
        <td  width="32%" height="22" bgcolor="#f5f5f5" class="STYLE6">
          <div align="left">&nbsp;下放业务员名称：</div>
        </td>
        <td width="68%" height="22" bgcolor="#f5f5f5" class="STYLE6">
       	 <input id="ywyid1" type="hidden"></input>
          <input id="ywyname1" name="textfield" type="text"  disabled="disabled"  size="15"/> 
          <a href="#" onclick="showUsers1()">
          <input type="submit" name="Submit2" value="选择业务员" />
          </a></td>
      </tr>
	  <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;位置分布：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><select id="wzfb1" name="select">
		
          <option >左</option>
          <option>右</option>
        
        </select>
        </td>
	  </tr> 
	</table>
	<table width="100%" align="center" >
	<tr>
        <td height="25" colspan="2" bgcolor="#1C94C4"><div align="center" class="STYLE6">
            <form action="" method="post" name="form1" id="form1">
              <label>
              <input type="button" name="Submit" value="修改"  onclick="winalert()"/>
              </label>
            </form>
        </div></td>
      </tr>
	</table>
	</td>
  </tr>
</table>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
	<script language="javascript">
	function clickCheckbox()
	{
		if(document.getElementById("checkbox").checked)
		{
			document.getElementById("xiafang").style.display="block"; 
		}else{
		document.getElementById("xiafang").style.display="none"; 
		}

	}
	$.get("../user/fetchcities",{},function(json){
		var opStr = "";
		for(var i = 0,l = json.length ; i < l ; i++)
		{
			opStr += "<option>" + json[i].CityName + "</option>";
		}
		$("#cities").empty().append(opStr);
	});
	
		var url = window.location + "";
		var id = url.substring(url.indexOf("?id=") + 4, url.length);
		$.get("../shop/shopinfo", {
			id : id
		}, function(json) {
			$("#shopid").prop("value", json.ID);
			$("#ywyid").prop("value", json.SalesmanID);
			$("#ywyname").prop("value", json.SalesmanName);
			$("#mryname").prop("value", json.BeautyShopName);
			$("#mrybh").prop("value", json.BeautyShopNumber);
			$("#wzfb").prop("value", json.BeautyShopPlace);
			$("#initintegral").prop("value", json.InitIntegral);
			//$("#ljhxjf").prop("value", json.TotalIntegral);
			$("#address").prop("value", json.BeautyShopAddress);
			$("#cities").prop("value", json.BeautyShopCity);
			$("#telphone").prop("value", json.Telephone);
			$("#banknum").prop("value", json.BankNum);
			$("#bz").prop("value", json.Description);
			$("#lylx").prop("value", json.SourceType);
			$("#lxr").prop("value", json.RelationMan);
			var num = json.shopnum;
			if(parseInt(num) > 5){
				document.getElementById("downshop").style.display="block"; 
			}else{
				document.getElementById("downshop").style.display="none"; 
			}
		});
		function winalert() {
			var ywyname = $("#ywyname").val();
			var mryname = $("#mryname").val();
			var mrybh = $("#mrybh").val();
			if(ywyname == null || ywyname == ""){
				alert("请先选择业务员！");
				return;
			}
			if(mryname == null || mryname == ""){
				alert("请填写美容院名称！");
				return;
			}
			if(mrybh == null || mrybh == ""){
				alert("请填写美容院编号！");
				return;
			}
			$.post("../shop/edit", {
				id:$("#shopid").val(),
				ywyid:$("#ywyid").val(),
				ywyname:$("#ywyname").val(),
				wzfb1:$("#wzfb1").val(),
				ywyid1:$("#ywyid1").val(),
				ywyname1:$("#ywyname1").val(),
				mryname:$("#mryname").val(),
				mrybh:$("#mrybh").val(),
				wzfb:$("#wzfb").val(),
				initintegral:$("#initintegral").val(),
				address:$("#address").val(),
				cities:$("#cities").val(),
				telphone:$("#telphone").val(),
				banknum:$("#banknum").val(),
				bz:$("#bz").val(),
				lylx:$("#lylx").val(),
				lxr:$("#lxr").val()
			}, function(json) {
				if(json)
					{
					alert("更新成功");
					window.returnValue = "1";
					window.close();
					}
			});
		}
		function showUsers(){
			var value = showModalDialog('VerificationUsers.html','选择业务员','dialogWidth:500px;dialogHeight:600px; dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes'); 
			var ywy = value.split(",");
			$("#ywyid").prop("value",ywy[0]);
			$("#ywyname").prop("value",ywy[1]);
		}
		
		function showUsers1(){
			var value = showModalDialog('VerificationUsers.html','选择业务员','dialogWidth:500px;dialogHeight:600px; dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes'); 
			var ywy = value.split(",");
			$("#ywyid1").prop("value",ywy[0]);
			$("#ywyname1").prop("value",ywy[1]);
		}
	</script>
</body>
</html>
